<h1 class="users"><?php echo $__title ?></h1>

<div style="text-align:right;">
    <?php $formulaire->render() ?>
</div>

<?php if (empty($users)): ?>
    <p>Il n'y a aucun utilisateur répondant à votre recherche <strong><?php echo $filter ?></strong>.</p>
<?php else: ?>
    <table class="list">
        <thead>
            <tr>
                <th class="checkbox">Id</th>
                <th>Utilisateur</th>
                <th colspan="2">Actions</th>
            </tr>
        </thead>
        <tbody>
    <?php foreach($users AS $key=>$user): ?>
            <tr <?php if ($key%2>0): ?>class="even"<?php endif; ?>>
                <td class="checkbox"><?php echo $user->getId() ?></td>
                <td><?php echo $user->getName() ?> (<?php echo $user->getEmail() ?>)</td>
                <td class="action"><a class="edit" href="<?php link_to('admin', 'users', 'edit', $user->getId()) ?>" title="Modifier cet utilisateur"></a></td>
                <td class="action"><a class="delete" href="<?php link_to('admin', 'users', 'delete', $user->getId()) ?>" title="Supprimer cet utilisateur"></a></td>
            </tr>
    <?php endforeach; ?>
        </tbody>
    </table>
    <?php $pagination->render(); ?>
<?php endif; ?>
<script type="text/javascript">
    $(function() { 
       $('input[name=id-identifiant-ou-adresse-e-mail]')
            .css('width', 230)
            .defaultValue();


       // Pagination recharge la recherche !
       $('.pagination a').bind('click', function(){ 
            $('form.formlist').attr('action', $(this).attr('href'));
            $('form.formlist input[type=submit]').click();
            return false;
       });
    });
</script>